<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css" />
		<link rel="stylesheet" type="text/css" href="../../css/jquery-weui.min.css" />
		<link rel="stylesheet" type="text/css" href="../../css/index.css" />
		<link rel="stylesheet" type="text/css" href="../../css/order.css" />
		<title>历史交易</title>
		<script src="../../js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/jquery-weui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/baseConfig.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<!--<div id="header">
			<div class="header-title" style="position: fixed;top: 0;">
				<img src="../../img/left.png" class="left" />
				<span>历史交易</span>
			</div>
		</div>-->

		<div class="weui-search-bar" id="searchBar" style="margin-top: 0;">
			<form class="weui-search-bar__form">
				<div class="weui-search-bar__box">
					<i class="weui-icon-search"></i>
					<input type="search" class="weui-search-bar__input" id="searchInput"  placeholder="搜索" required="">
					<a href="javascript:" class="weui-icon-clear" id="searchClear"></a>
				</div>
				<label class="weui-search-bar__label" id="searchText">
				      <i class="weui-icon-search"></i>
				      <span>搜索</span>
				    </label>
			</form>
			 <!--<a href="javascript:" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a>-->
		</div>
		<div class="order-content">
			<ul class="order-list">
				<!--<li>
						<p class="first_p">
							<span>HSGFG6500234982298</span>							
						</p>
						<p class="second_p">
							<span>9340.89  吨</span>
						</p>
						<p class="third_p">
							<span class="time">2017/06/28 10:35:45</span>						
						</p>
						<p class="four_p">
							<span>待提交</span>
						</p>
						<img src="../../img/right.png"/>
					</li>
				<li>
						<p class="first_p">
							<span>HSGFG6500234982298</span>							
						</p>
						<p class="second_p">
							<span>9340.89  吨</span>
						</p>
						<p class="third_p">
							<span class="time">2017/06/28 10:35:45</span>						
						</p>
						<p class="four_p">
							<span>待提交</span>
						</p>
						<img src="../../img/right.png"/>
					</li>	-->
			</ul>
		</div>
		<!--<div class="weui-loadmore" style="margin-bottom: 2.5rem;">
			<i class="weui-loading"></i>
			<span class="weui-loadmore__tips">正在加载</span>
		</div>-->
	</body>
	<script type="text/javascript">
		$(document).ready(function(){
			baseConfig.historyBack();
			$.showLoading("加载中...");
			searchHistory()
			$("#searchInput").bind("input propertychange",function(){
				var value = $(this).val()
				searchHistory(value)
			})
			function searchHistory(value){
			$.ajax({
					type: "get",
					url: baseConfig.localHttp+"weChatApi/fgclient/getOrderHistory",
					async: false,
					headers: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					data: {
						clientId: baseConfig.login(),
						keywords:value
					},
					success: function(data) {
						$.hideLoading();
						if(data.code==100){
							$(".order-list").empty()
							var content = data.content;
							var $li="";
							for(var i=0;i<content.length;i++){
								$li += "<li data-id="+content[i].id+"><p class='first_p'><span>"+content[i].orderNo+"</span></p>"
								$li += "<p class='second_p'><span>"+content[i].weight+"吨</span></p>"
								$li += "<p class='third_p'><span class='time'>"+content[i].orderSubmitTime+"</span></p>"
//								$li += "<p class='four_p'></p>"
								$li += "<img src='../../img/right.png'/></li>"
							}
							$(".order-list").append($li)
							$(".order-list li").on("click",function(){
								var id = $(this).attr("data-id");
								location.href = "../order/orderInformation.html?orderid="+id
							})
						}else{
							$.toptip(data.content, 1200, 'error');
						}
						console.log(data)
					},
					error:function(){
						
					}
				})	
			}	
			})	

	</script>

</html>
<li>